<?php
//后台登陆控制
include_once('admin_global.php');
$db->Get_user_shell_check($uid, $shell);   //检测用户是否登录
$db->Get_user_type_check($uid, $shell);    //检测用户权限
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>管理友情链接</title>
    <link rel="stylesheet" href="css/right.css" type="text/css" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/bggl.js" type="text/javascript"></script>
</head>
<script>
    function delLinks_check()
    {
        if (window.confirm("你确定要删除该链接吗？"))
            return true;
        else
            return false;
    }
</script>
<?php
//查询出所有友情链接
$sql="SELECT * FROM links";
$query = $db->query($sql);
while($row=$db->fetch_array($query)){
    $data[]=$row;
}
?>
<body>
<div id="right_main">
    <div class="right_content">
        <div class="right_top_menu">
            <h3>
                您当前的位置：后台 > 基本设置 > 管理友情链接
            </h3>
        </div>
        <div class="right_center_content">
            <form id="form1" method="post" action="">
                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top" >
                            <div class="txl_search"></div>
                            <table cellpadding="0" cellspacing="0" border="0" width="100%" class="fg_table txl_table" id="table1">
                                <tr>
                                    <th width="10%">链接ID</th>
                                    <th width="25%">链接名称</th>
                                    <th width="35%">链接地址</th>
                                    <th width="10%">排列顺序</th>
                                    <th width="10%">是否有效</th>
                                    <th width="5%">修改</th>
                                    <th width="5%">删除</th>
                                </tr>
                                <?php foreach($data as $row){; ?>
                                    <tr>
                                        <td><?php echo $row['linkID']; ?></td>
                                        <td align="left"><?php echo $row['linkName']; ?></td>
                                        <td align="left"><?php echo $row['linkUrl']; ?></td>
                                        <td><?php echo $row['linkIndex']; ?></td>
                                        <?php
                                        if($row['isEnabled']==1){
                                            $isEnabled="是";
                                        }else{
                                            $isEnabled="否";
                                        }
                                        ?>
                                        <td><?php echo $isEnabled; ?></td>
                                        <td><a href="editLinks.php?linkID=<?php echo $row['linkID']; ?>"><img src="images/adj_bg.gif" width="15" height="15" border="0" /></a></td>
                                        <td><a href="delLinks.php?linkID=<?php echo $row['linkID']; ?>" onclick="javascript:return delLinks_check();"><img src="images/del2.gif" width="16" height="16" border="0" /></a></td>
                                    </tr>
                                <?php }; ?>
                            </table>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
</body>
</html>
